package practice2;

import java.util.Scanner;

public class P8605 {

    private static int n;   //节点个数
    private static int m;   //通道个数

    private static String[] nodes = new String[10001];      //下标为节点，值为与该节点相连的节点结合
    private static int[] a = new int[5];          //下标为深度，值为节点数，记录走法
    private static int count = 0;

    public static void dfs(int points,int step){    //当前节点，当前步数
        if(step == 4 ){
            if(a[1]==a[2] || a[1]==a[3] || a[2]==a[3] || a[2]==a[4] || a[3]==a[4]){     //中间两个节点只在路径中出现一次
                return;
            }
            count++;
            return;
        }
        String str = nodes[points];
        String[] strings = str.split(",");
        for(int i=0;i<strings.length;i++){
            int next = Integer.parseInt(strings[i]);
            a[step+1] = next;
            dfs(next,step+1);
            a[step+1] = 0;          //回溯
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n=sc.nextInt();
        m=sc.nextInt();
        for(int i=0;i<m;i++){
            int u =sc.nextInt();
            int v =sc.nextInt();
            String x = nodes[u];
            String y = nodes[v];
            if(x == null && y == null){
                nodes[u] = v+"";
                nodes[v] = u+"";
            }else if(x == null && y != null){
                nodes[u] = v+"";
                nodes[v] = y+","+u;
            }else if(x != null && y == null){
                nodes[u] = x+","+v;
                nodes[v] = u+"";
            }else {
                nodes[u] = x+","+v;
                nodes[v] = y+","+u;
            }
        }
        for(int i=1;i<=n;i++){
            a[1] = i;
            dfs(i,1);
            a[1] = 0;
        }
        System.out.println(count);
    }
}
